var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    items2:[{
      name:"order",surnname:"张三",phone:"137333332222",add:"长沙市天心区解放路一单元110号少时诵诗书所所所所所所所所所所所所", value:"预约取件",checked: 'true' 
     },{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
     ,{ name:"fast",surnname:"李四",phone:"137333354222",add:"东莞市天心区解放路一单元110号",value:"快速取件"}
    ],
    num:"",
    list:{surnname:"",phone:"",add:""}
    //  radioStr2: '预约取件'
  },

  //获取单选事件被选中的数据
  radioChange2: function (e) {
    var str = null;
    for (var value of this.data.items2) {
      if (value.name === e.detail.value) {
        str = value.value;
        this.data.list.add=value.add;
        this.data.list.surnname=value.surnname;
        this.data.list.phone=value.phone;

        break;
      }
    }
    // this.setData({ radioStr: str });
    console.log(str)
    console.log(this.data.list)
  },

  //确定事件触发
  gotodefine:function(){
    wx.switchTab({
      url:  '/pages/work/work'    //注意switchTab只能跳转到带有tab的页面，不能跳转到不带tab的页面
    })

  },

  //添加个人地址
  toAddress(){
    wx.navigateTo({
      url: '/pages/addAddress/addAddress',
    })
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //获取从work页面传来的值
    var that = this
    that.setData({
      num:options.num
    })
   console.log(that.data.num)
   console.log(this.data.list)
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})